package com.example.evanproject.mapper;

import com.example.evanproject.domain.Chatlist;
import com.example.evanproject.domain.Register;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
* @author hanxiaoqi
* @description 针对表【register】的数据库操作Mapper
* @createDate 2024-03-09 21:52:13
* @Entity generator.domain.Register
*/
@Mapper
public interface RegisterMapper extends BaseMapper<Register> {
    @Select("select * from chatlist where (send_id=#{userid1} and to_id=#{userid2}) or (send_id=#{userid2} and to_id=#{userid1}) ORDER BY createtime")
    List<Chatlist> selectchatrecordsbytwoid(Integer userid1, Integer userid2);

    Integer register(Register register);
    public Register selectbyphone(@Param("phonenum") String phonenum);
    @Select("select * from register WHERE s_phone=#{phonenum} AND s_password=#{password}")
    Register login(@Param("phonenum") String phonenum, @Param("password") String password);
    /*用户登录（验证码登录）*/
    @Select("select * from register WHERE s_phone=#{phonenum}")
    Register login1(@Param("phonenum") String phonenum);

    //    筛选用户（多个id）
    List<Register> morepople(Integer[] str);

    Map<String, Object> selectteacher(Integer id);
//按照id 查询用户



    @Select("select * from register where s_id=#{id}")
    Register selectById(Integer id);

    //    修改信息
    Integer modifyinfolist(String name, Integer age, Integer sex, String filename,Integer id);


    List<Map> countNum(String year);
}




